package com.jake.mallseckill.multithreading;

import org.apache.commons.lang.math.RandomUtils;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ExecutorLearner {

    public static void main(String[] args) {

        ExecutorService service = Executors.newFixedThreadPool(10);
//        ExecutorService service = Executors.newCachedThreadPool();
//        ScheduledExecutorService service = Executors.newScheduledThreadPool(10);
//        ExecutorService service = Executors.newSingleThreadExecutor();
        for (int i = 0; i < 100; i++) {
            service.execute(new Runnable() {
                private int cnt = 100;

                @Override
                public void run() {
                    System.out.println(cnt--);
                }
            });
//            System.out.println("==========for循环分割线==========");
        }

    }

}
